package com.client.controller;

import com.client.model.ClientSocketThread;

import java.util.HashMap;

/**
 * @author lxl
 * @date 2020/12/26 - 14:37
 */
/*
这是一个管理客户端和服务器保持通讯的线程
 */
public class ClientSocketThreadManager {
    private static HashMap map= new HashMap<String, ClientSocketThread>();

    //创建好的线程放入到map中
    public static void addClient(String uid, ClientSocketThread ccst){
        map.put(uid,ccst);
    }

    //通过qqid获得该线程
    public static ClientSocketThread getClientConServerThread(String uid){
        return (ClientSocketThread)map.get(uid);
    }
    public static void remove(String uid){
        map.remove(uid);
    }
}
